const state = {
	houseList: [],
	buildList: [],
	unitList: [],
	roomList: [],
	roomIds: []
}

const actions = {
	updateHouseList({
		commit
	}, list) {
		commit('UPDATE_HOUSELIST', list);
	},
	updateBuildList({
		commit
	}, list) {
		commit('UPDATE_BUILDLIST', list);
	},
	updateUnitList({
		commit
	}, list) {
		commit('UPDATE_UNITLIST', list);
	},
	updateRoomList({
		commit
	}, list) {
		commit('UPDATE_ROOMLIST', list);
	},
	updateRoomIds({
		commit
	}, list) {
		commit('UPDATE_ROOMIDS', list);
	},
	addHouse({
		commit
	}, info) {
		commit('ADD_HOUSE', info);
	}
}

const mutations = {
	UPDATE_HOUSELIST(state, list = []) {
		state.houseList = list;
	},
	UPDATE_BUILDLIST(state, list = []) {
		state.buildList = list;
	},
	UPDATE_UNITLIST(state, list = []) {
		state.unitList = list;
	},
	UPDATE_ROOMLIST(state, list = []) {
		state.roomList = list;
	},
	UPDATE_ROOMIDS(state, list = []) {
		state.roomIds = list;
	},
	ADD_HOUSE(state, info = {}) {
		state.houseList = [...state.houseList, info];
	}
}

const getters = {
}

export default {
	namespaced: true,
	state,
	getters,
	actions,
	mutations
}
